import cv2
import numpy as np

# 创建一个空白图像
blank_image = np.zeros((500, 500, 3), dtype=np.uint8)

# 定义梯形的顶点坐标
top_left = (200, 300)
top_right = (300, 300)
bottom_left = (150, 150)
bottom_right = (350, 150)

# 将顶点坐标按照顺序放入列表中
pts = np.array([[top_left, top_right, bottom_right, bottom_left]])

# 在图像上绘制多边形
cv2.polylines(blank_image, [pts], True, (0, 255, 0), 2)

# 显示图像
cv2.imshow('等边梯形', blank_image)
cv2.waitKey(0)
cv2.destroyAllWindows()